/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is Forte for Java, Community Edition. The Initial
* Developer of the Original Code is Sun Microsystems, Inc. Portions
* Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.modules.vcs.cmdline;
import java.io.*;
import java.util.*;
import java.beans.*;
import java.text.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import org.openide.*;
import org.openide.util.*;
import org.netbeans.modules.vcs.*;
import org.netbeans.modules.vcs.util.*;
/** Customizer
*
* @author Pavel Buzek
*/
public class CvsCustomizer extends javax.swing.JPanel implements Customizer {
private Debug E=new Debug("CvsCustomizer", true); // NOI18N
private Debug D=new Debug("CvsCustomizer", true); // NOI18N
private javax.swing.ButtonGroup bg;
static final long serialVersionUID =-4163355905662053542L;
/** Creates new panel CvsCustomizer */
public CvsCustomizer() {
D.deb("constructor called");
changeSupport=new PropertyChangeSupport(this);
initComponents ();
javax.swing.ButtonGroup bg = new javax.swing.ButtonGroup ();
bg.add (localRadioButton);
bg.add (serverRadioButton);
bg.add (pserverRadioButton);
loginButton.setMnemonic(KeyEvent.VK_G);
browseButton.setMnemonic(KeyEvent.VK_W);
repositoryButton.setMnemonic(KeyEvent.VK_R);
localRadioButton.setMnemonic(KeyEvent.VK_L);
serverRadioButton.setMnemonic(KeyEvent.VK_S);
pserverRadioButton.setMnemonic(KeyEvent.VK_P);
moduleSelectButton.setMnemonic(KeyEvent.VK_M);
cvsExeButton.setMnemonic(KeyEvent.VK_E);
cygwinCheckBox.setMnemonic(KeyEvent.VK_U);
cygwinButton.setMnemonic(KeyEvent.VK_B);
localRadioButton.requestFocus ();
removeEnterFromKeymap();
D.deb("constructor update ...");
updateEnabledComponents ();
D.deb("constructor localize ...");
localizeComponents();
D.deb("constructor help ...");
HelpCtx.setHelpIDString (this, CvsCustomizer.class.getName ());
//rootDirChanged(false);
D.deb("constructor done");
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {//GEN-BEGIN:initComponents
connectionPanel = new javax.swing.JPanel ();
localRadioButton = new javax.swing.JRadioButton ();
serverRadioButton = new javax.swing.JRadioButton ();
pserverRadioButton = new javax.swing.JRadioButton ();
userNameLabel = new javax.swing.JLabel ();
userTextField = new javax.swing.JTextField ();
propsPanel = new javax.swing.JPanel ();
serverTextField = new javax.swing.JTextField ();
serverLabel = new javax.swing.JLabel ();
repositoryLabel = new javax.swing.JLabel ();
repositoryTextField = new javax.swing.JTextField ();
repositoryButton = new javax.swing.JButton ();
rootDirLabel = new javax.swing.JLabel ();
rootDirTextField = new javax.swing.JTextField ();
browseButton = new javax.swing.JButton ();
moduleLabel = new javax.swing.JLabel ();
moduleTextField = new javax.swing.JTextField ();
moduleSelectButton = new javax.swing.JButton ();
relMountLabel = new javax.swing.JLabel ();
relMountTextField = new javax.swing.JTextField ();
cvsExeLabel = new javax.swing.JLabel ();
cvsExeTextField = new javax.swing.JTextField ();
cvsExeButton = new javax.swing.JButton ();
cygwinCheckBox = new javax.swing.JCheckBox ();
cygwinLabel = new javax.swing.JLabel ();
cygwinTextField = new javax.swing.JTextField ();
cygwinButton = new javax.swing.JButton ();
refreshLabel = new javax.swing.JLabel ();
refreshTextField = new javax.swing.JTextField ();
jLabel10 = new javax.swing.JLabel ();
loginButton = new javax.swing.JButton ();
setLayout (new java.awt.GridBagLayout ());
java.awt.GridBagConstraints gridBagConstraints1;
setOpaque (false);
connectionPanel.setLayout (new java.awt.GridBagLayout ());
java.awt.GridBagConstraints gridBagConstraints2;
connectionPanel.setBorder (new javax.swing.border.TitledBorder(
new javax.swing.border.EtchedBorder(), "CVS Connection Type"));
localRadioButton.setSelected (true);
localRadioButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.localRadioButton.text"));
localRadioButton.setNextFocusableComponent (serverRadioButton);
localRadioButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
localRadioButtonActionPerformed (evt);
}
}
);
gridBagConstraints2 = new java.awt.GridBagConstraints ();
gridBagConstraints2.gridwidth = 2;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints2.weightx = 1.0;
connectionPanel.add (localRadioButton, gridBagConstraints2);
serverRadioButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.serverRadioButton.text"));
serverRadioButton.setNextFocusableComponent (pserverRadioButton);
serverRadioButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
serverRadioButtonActionPerformed (evt);
}
}
);
gridBagConstraints2 = new java.awt.GridBagConstraints ();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 1;
gridBagConstraints2.gridwidth = 2;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints2.weightx = 1.0;
connectionPanel.add (serverRadioButton, gridBagConstraints2);
pserverRadioButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.pserverRadioButton.text"));
pserverRadioButton.setNextFocusableComponent (userTextField);
pserverRadioButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
pserverRadioButtonActionPerformed (evt);
}
}
);
gridBagConstraints2 = new java.awt.GridBagConstraints ();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 2;
gridBagConstraints2.gridwidth = 2;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints2.weightx = 1.0;
connectionPanel.add (pserverRadioButton, gridBagConstraints2);
userNameLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.userNameLabel.text"));
gridBagConstraints2 = new java.awt.GridBagConstraints ();
gridBagConstraints2.gridx = 0;
gridBagConstraints2.gridy = 3;
gridBagConstraints2.insets = new java.awt.Insets (8, 32, 8, 8);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
connectionPanel.add (userNameLabel, gridBagConstraints2);
userTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.userTextField.toolTipText"));
userTextField.setText ("");
userTextField.setNextFocusableComponent (serverTextField);
userTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
userTextFieldActionPerformed (evt);
}
}
);
userTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
userTextFieldFocusLost (evt);
}
}
);
gridBagConstraints2 = new java.awt.GridBagConstraints ();
gridBagConstraints2.gridx = 1;
gridBagConstraints2.gridy = 3;
gridBagConstraints2.gridwidth = 0;
gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints2.insets = new java.awt.Insets (8, 0, 8, 8);
gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints2.weightx = 1.0;
connectionPanel.add (userTextField, gridBagConstraints2);
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.gridx = 0;
gridBagConstraints1.gridy = 0;
gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints1.insets = new java.awt.Insets (8, 8, 8, 8);
gridBagConstraints1.weightx = 1.0;
gridBagConstraints1.weighty = 0.4;
add (connectionPanel, gridBagConstraints1);
propsPanel.setLayout (new java.awt.GridBagLayout ());
java.awt.GridBagConstraints gridBagConstraints3;
propsPanel.setBorder (new javax.swing.border.TitledBorder(
new javax.swing.border.EtchedBorder(), "CVS Settings"));
serverTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.serverTextField.toolTipText"));
serverTextField.setPreferredSize (new java.awt.Dimension(150, 20));
serverTextField.setMinimumSize (new java.awt.Dimension(150, 20));
serverTextField.setNextFocusableComponent (repositoryTextField);
serverTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
serverTextFieldActionPerformed (evt);
}
}
);
serverTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
serverTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 0;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 0.8;
propsPanel.add (serverTextField, gridBagConstraints3);
serverLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.serverLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 0;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (serverLabel, gridBagConstraints3);
repositoryLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.repositoryLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 1;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (repositoryLabel, gridBagConstraints3);
repositoryTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.repositoryTextField.toolTipText"));
repositoryTextField.setNextFocusableComponent (rootDirTextField);
repositoryTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
repositoryTextFieldActionPerformed (evt);
}
}
);
repositoryTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
repositoryTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 1;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 0.8;
propsPanel.add (repositoryTextField, gridBagConstraints3);
repositoryButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.repositoryButton.text"));
repositoryButton.setNextFocusableComponent (rootDirTextField);
repositoryButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
repositoryButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 3;
gridBagConstraints3.gridy = 1;
gridBagConstraints3.gridwidth = 0;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
propsPanel.add (repositoryButton, gridBagConstraints3);
rootDirLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.rootDirLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 2;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (rootDirLabel, gridBagConstraints3);
rootDirTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.rootDirTextField.toolTipText"));
rootDirTextField.setNextFocusableComponent (moduleTextField);
rootDirTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
rootDirTextFieldActionPerformed (evt);
}
}
);
rootDirTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
rootDirTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 2;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 0.8;
propsPanel.add (rootDirTextField, gridBagConstraints3);
browseButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.browseButton.text"));
browseButton.setNextFocusableComponent (refreshTextField);
browseButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
browseButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 3;
gridBagConstraints3.gridy = 2;
gridBagConstraints3.gridwidth = 0;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
propsPanel.add (browseButton, gridBagConstraints3);
moduleLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.moduleLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 3;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (moduleLabel, gridBagConstraints3);
moduleTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.moduleTextField.toolTipText"));
moduleTextField.setNextFocusableComponent (relMountTextField);
moduleTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
moduleTextFieldActionPerformed (evt);
}
}
);
moduleTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
moduleTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 3;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 0.8;
propsPanel.add (moduleTextField, gridBagConstraints3);
moduleSelectButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.moduleSelectButton.text"));
moduleSelectButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
moduleSelectButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 3;
gridBagConstraints3.gridy = 3;
gridBagConstraints3.gridwidth = 0;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
propsPanel.add (moduleSelectButton, gridBagConstraints3);
relMountLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.relMountLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 4;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (relMountLabel, gridBagConstraints3);
relMountTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.relMountTextField.toolTipText"));
relMountTextField.setNextFocusableComponent (cvsExeTextField);
relMountTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
relMountTextFieldActionPerformed (evt);
}
}
);
relMountTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
relMountTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 4;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 1.0;
propsPanel.add (relMountTextField, gridBagConstraints3);
cvsExeLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cvsExeLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 5;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (cvsExeLabel, gridBagConstraints3);
cvsExeTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cvsExeTextField.toolTipText"));
cvsExeTextField.setNextFocusableComponent (cygwinCheckBox);
cvsExeTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
cvsExeTextFieldActionPerformed (evt);
}
}
);
cvsExeTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
cvsExeTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 5;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 1.0;
propsPanel.add (cvsExeTextField, gridBagConstraints3);
cvsExeButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cvsExeButton.text"));
cvsExeButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
cvsExeButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 3;
gridBagConstraints3.gridy = 5;
gridBagConstraints3.gridwidth = 0;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
propsPanel.add (cvsExeButton, gridBagConstraints3);
cygwinCheckBox.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cygwinCheckBox.toolTipText"));
cygwinCheckBox.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cygwinCheckBox.text"));
cygwinCheckBox.setNextFocusableComponent (cygwinTextField);
cygwinCheckBox.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
cygwinCheckBoxActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 6;
gridBagConstraints3.gridwidth = 3;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints3.weightx = 1.0;
propsPanel.add (cygwinCheckBox, gridBagConstraints3);
cygwinLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cygwinLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 7;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (cygwinLabel, gridBagConstraints3);
cygwinTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cygwinTextField.toolTipText"));
cygwinTextField.setNextFocusableComponent (refreshTextField);
cygwinTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
cygwinTextFieldActionPerformed (evt);
}
}
);
cygwinTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
cygwinTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 7;
gridBagConstraints3.gridwidth = 2;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.weightx = 1.0;
propsPanel.add (cygwinTextField, gridBagConstraints3);
cygwinButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cygwinButton.text"));
cygwinButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
cygwinButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 3;
gridBagConstraints3.gridy = 7;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
propsPanel.add (cygwinButton, gridBagConstraints3);
refreshLabel.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.refreshLabel.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 8;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 0, 0);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (refreshLabel, gridBagConstraints3);
refreshTextField.setToolTipText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.refreshTextField.toolTipText"));
refreshTextField.setPreferredSize (new java.awt.Dimension(50, 20));
refreshTextField.setMinimumSize (new java.awt.Dimension(50, 20));
refreshTextField.setText ("0");
refreshTextField.setNextFocusableComponent (loginButton);
refreshTextField.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
refreshTextFieldActionPerformed (evt);
}
}
);
refreshTextField.addFocusListener (new java.awt.event.FocusAdapter () {
public void focusLost (java.awt.event.FocusEvent evt) {
refreshTextFieldFocusLost (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 1;
gridBagConstraints3.gridy = 8;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints3.weightx = 0.4;
propsPanel.add (refreshTextField, gridBagConstraints3);
jLabel10.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.jLabel10.text"));
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 2;
gridBagConstraints3.gridy = 8;
gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints3.insets = new java.awt.Insets (8, 0, 0, 8);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints3.weightx = 0.6;
propsPanel.add (jLabel10, gridBagConstraints3);
loginButton.setText (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.loginButton.text"));
loginButton.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
loginButtonActionPerformed (evt);
}
}
);
gridBagConstraints3 = new java.awt.GridBagConstraints ();
gridBagConstraints3.gridx = 0;
gridBagConstraints3.gridy = 9;
gridBagConstraints3.insets = new java.awt.Insets (8, 8, 8, 8);
gridBagConstraints3.anchor = java.awt.GridBagConstraints.WEST;
propsPanel.add (loginButton, gridBagConstraints3);
gridBagConstraints1 = new java.awt.GridBagConstraints ();
gridBagConstraints1.gridx = 0;
gridBagConstraints1.gridy = 1;
gridBagConstraints1.gridwidth = 2;
gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints1.insets = new java.awt.Insets (0, 8, 8, 8);
gridBagConstraints1.weightx = 1.0;
gridBagConstraints1.weighty = 0.5;
add (propsPanel, gridBagConstraints1);
}//GEN-END:initComponents
private void relMountTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_relMountTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsModule (relMountTextField.getText ());
rootDirChanged(false);
}//GEN-LAST:event_relMountTextFieldFocusLost
private void relMountTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_relMountTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsModule (relMountTextField.getText ());
rootDirChanged(false);
}//GEN-LAST:event_relMountTextFieldActionPerformed
private void moduleSelectButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleSelectButtonActionPerformed
// Add your handling code here:
VcsConfigVariable var = (VcsConfigVariable) fileSystem.getVariablesByName().get ("MODULE_NAME");
if (var == null) return;
String exec = var.getCustomSelector();
OutputContainer container = new OutputContainer(g("MSG_VariableSelector"));
final ExecuteSelector es = new ExecuteSelector(fileSystem, exec, "MODULE_NAME",
fileSystem.getVariablesAsHashtable());
es.setErrorNoRegexListener(container);
es.setOutputNoRegexListener(container);
es.setErrorContainer(container);
//javax.swing.SwingUtilities.invokeLater(new Runnable() {
//public void run() {
new Thread ("CVS-ModuleSelection") {
public void run() {
es.start();
try {
es.join();
} catch (InterruptedException e) {
return;
}
String selection = es.getSelection();
if (selection != null && selection.length() > 0) {
moduleTextField.setText(selection);
fileSystem.setCvsModuleName(selection);
//rootDirChanged(false);
}
}
}.start();
//}
//});
}//GEN-LAST:event_moduleSelectButtonActionPerformed
private void localizeComponents() {
javax.swing.border.TitledBorder border = (javax.swing.border.TitledBorder) connectionPanel.getBorder();
border.setTitle(org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.connectionPanel.borderTitle"));
border = (javax.swing.border.TitledBorder) propsPanel.getBorder();
border.setTitle(org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.propsPanel.borderTitle"));
}
private void cvsExeTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cvsExeTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsExePath (cvsExeTextField.getText());
}//GEN-LAST:event_cvsExeTextFieldActionPerformed
private void cygwinTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cygwinTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCygwinPath (cygwinTextField.getText());
}//GEN-LAST:event_cygwinTextFieldActionPerformed
private void cygwinTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_cygwinTextFieldFocusLost
// Add your handling code here:
fileSystem.setCygwinPath (cygwinTextField.getText());
}//GEN-LAST:event_cygwinTextFieldFocusLost
private void cvsExeTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_cvsExeTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsExePath (cvsExeTextField.getText());
}//GEN-LAST:event_cvsExeTextFieldFocusLost
private void cygwinCheckBoxActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cygwinCheckBoxActionPerformed
// Add your handling code here:
fileSystem.setUseUnixShell(cygwinCheckBox.isSelected());
updateEnabledComponents ();
}//GEN-LAST:event_cygwinCheckBoxActionPerformed
private void cygwinButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cygwinButtonActionPerformed
// Add your handling code here:
ChooseFileDialog chooseFile=new ChooseFileDialog(new JFrame(), new File(cygwinTextField.getText ()), false);
MiscStuff.centerWindow (chooseFile);
HelpCtx.setHelpIDString (chooseFile.getRootPane (), CvsCustomizer.class.getName ());
chooseFile.show();
String selected=chooseFile.getSelectedFile();
if( selected==null ){
//D.deb("no directory selected"); // NOI18N
return ;
}
cygwinTextField.setText (selected);
fileSystem.setCygwinPath (selected);
}//GEN-LAST:event_cygwinButtonActionPerformed
private void cvsExeButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cvsExeButtonActionPerformed
// Add your handling code here:
ChooseFileDialog chooseFile=new ChooseFileDialog(new JFrame(), new File(cvsExeTextField.getText ()), false);
MiscStuff.centerWindow (chooseFile);
HelpCtx.setHelpIDString (chooseFile.getRootPane (), CvsCustomizer.class.getName ());
chooseFile.show();
String selected=chooseFile.getSelectedFile();
if( selected==null ){
//D.deb("no directory selected"); // NOI18N
return ;
}
cvsExeTextField.setText (selected);
fileSystem.setCvsExePath (selected);
}//GEN-LAST:event_cvsExeButtonActionPerformed
private void moduleTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_moduleTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsModuleName (moduleTextField.getText ());
}//GEN-LAST:event_moduleTextFieldFocusLost
private void moduleTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsModuleName (moduleTextField.getText ());
}//GEN-LAST:event_moduleTextFieldActionPerformed
private void userTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_userTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsUserName (userTextField.getText ());
}//GEN-LAST:event_userTextFieldFocusLost
private void userTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsUserName (userTextField.getText ());
}//GEN-LAST:event_userTextFieldActionPerformed
private void loginButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginButtonActionPerformed
// Add your handling code here:
String messageLabel = org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.loginHOWTO");
String messageText = "cvs -d :" + fileSystem.getCvsServerType () + ":" +fileSystem.getCvcRootForServerType ()+" login";
JDialog dlg = notifyMessageTF(messageLabel, messageText);
dlg.setVisible(true);
//NotifyDescriptor nd = new NotifyDescriptor.Message (message);
//TopManager.getDefault ().notify (nd);
}//GEN-LAST:event_loginButtonActionPerformed
private void pserverRadioButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pserverRadioButtonActionPerformed
// Add your handling code here:
if(pserverRadioButton.isSelected ()) {
fileSystem.setCvsServerType (fileSystem.CVS_SERVER_PSERVER);
}
updateEnabledComponents ();
}//GEN-LAST:event_pserverRadioButtonActionPerformed
private void serverRadioButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serverRadioButtonActionPerformed
// Add your handling code here:
if(serverRadioButton.isSelected ()) {
fileSystem.setCvsServerType (fileSystem.CVS_SERVER_SERVER);
}
updateEnabledComponents ();
}//GEN-LAST:event_serverRadioButtonActionPerformed
private void localRadioButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_localRadioButtonActionPerformed
// Add your handling code here:
if(localRadioButton.isSelected ()) {
fileSystem.setCvsServerType (fileSystem.CVS_SERVER_LOCAL);
}
updateEnabledComponents ();
}//GEN-LAST:event_localRadioButtonActionPerformed
private void serverTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_serverTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsServer (serverTextField.getText ());
}//GEN-LAST:event_serverTextFieldFocusLost
private void serverTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_serverTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsServer (serverTextField.getText ());
}//GEN-LAST:event_serverTextFieldActionPerformed
private void repositoryTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repositoryTextFieldFocusLost
// Add your handling code here:
fileSystem.setCvsRoot (repositoryTextField.getText ());
}//GEN-LAST:event_repositoryTextFieldFocusLost
private void repositoryTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_repositoryTextFieldActionPerformed
// Add your handling code here:
fileSystem.setCvsRoot (repositoryTextField.getText ());
}//GEN-LAST:event_repositoryTextFieldActionPerformed
private void repositoryButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_repositoryButtonActionPerformed
// Add your handling code here:
ChooseDirDialog chooseDir=new ChooseDirDialog(new JFrame(), new File(repositoryTextField.getText ()));
MiscStuff.centerWindow (chooseDir);
HelpCtx.setHelpIDString (chooseDir.getRootPane (), CvsCustomizer.class.getName ());
chooseDir.show();
String selected=chooseDir.getSelectedDir();
if( selected==null ){
//D.deb("no directory selected"); // NOI18N
return ;
}
File dir=new File(selected);
if( !dir.isDirectory() ){
E.err("not directory "+dir); // NOI18N
return ;
}
repositoryTextField.setText(selected);
fileSystem.setCvsRoot (selected);
}//GEN-LAST:event_repositoryButtonActionPerformed
private void advancedButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advancedButtonActionPerformed
// Add your handling code here:
}//GEN-LAST:event_advancedButtonActionPerformed
private void refreshTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_refreshTextFieldFocusLost
// Add your handling code here:
refreshChanged ();
}//GEN-LAST:event_refreshTextFieldFocusLost
private void rootDirTextFieldFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_rootDirTextFieldFocusLost
// Add your handling code here:
if (isRootChanged() && !browseButton.isSelected()) rootDirChanged (true);
}//GEN-LAST:event_rootDirTextFieldFocusLost
private void refreshTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshTextFieldActionPerformed
// Add your handling code here:
refreshChanged ();
}//GEN-LAST:event_refreshTextFieldActionPerformed
private void browseButtonAction() {
ChooseDirDialog chooseDir=new ChooseDirDialog(new JFrame(), new File(rootDirTextField.getText ()));
MiscStuff.centerWindow (chooseDir);
HelpCtx.setHelpIDString (chooseDir.getRootPane (), CvsCustomizer.class.getName ());
chooseDir.show();
String selected=chooseDir.getSelectedDir();
if( selected==null ){
//D.deb("no directory selected"); // NOI18N
return ;
}
//String module = moduleTextField.getText ();
//String moduleDir = module.equals ("") ? selected : selected + java.io.File.separator + module; // NOI18N
File dir=new File(selected);
/*
if( !dir.isDirectory() ){
E.err("not directory "+dir); // NOI18N
return ;
}
*/
try{
rootDirTextField.setText(selected);
fileSystem.setRootDirectory(dir);
}
catch (PropertyVetoException veto){
fileSystem.debug(org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.canNotChangeWD"));
//E.err(veto,"setRootDirectory() failed"); // NOI18N
}
catch (IOException e){
E.err(e,"setRootDirectory() failed"); // NOI18N
} finally {
if (rootNotSetDlg != null) rootNotSetDlg.setVisible(false);
}
}
private void browseButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
// Add your handling code here:
D.deb("browseButtonActionPerformed()");
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
browseButtonAction();
}
});
}//GEN-LAST:event_browseButtonActionPerformed
private void rootDirTextFieldActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rootDirTextFieldActionPerformed
// Add your handling code here:
rootDirChanged (true);
}//GEN-LAST:event_rootDirTextFieldActionPerformed
private void removeConfigButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeConfigButtonActionPerformed
// Add your handling code here:
}//GEN-LAST:event_removeConfigButtonActionPerformed
private void saveAsButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveAsButtonActionPerformed
// Add your handling code here:
}//GEN-LAST:event_saveAsButtonActionPerformed
private void configComboItemStateChanged (java.awt.event.ItemEvent evt) {//GEN-FIRST:event_configComboItemStateChanged
// Add your handling code here:
}//GEN-LAST:event_configComboItemStateChanged
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel connectionPanel;
private javax.swing.JRadioButton localRadioButton;
private javax.swing.JRadioButton serverRadioButton;
private javax.swing.JRadioButton pserverRadioButton;
private javax.swing.JLabel userNameLabel;
private javax.swing.JTextField userTextField;
private javax.swing.JPanel propsPanel;
private javax.swing.JTextField serverTextField;
private javax.swing.JLabel serverLabel;
private javax.swing.JLabel repositoryLabel;
private javax.swing.JTextField repositoryTextField;
private javax.swing.JButton repositoryButton;
private javax.swing.JLabel rootDirLabel;
private javax.swing.JTextField rootDirTextField;
private javax.swing.JButton browseButton;
private javax.swing.JLabel moduleLabel;
private javax.swing.JTextField moduleTextField;
private javax.swing.JButton moduleSelectButton;
private javax.swing.JLabel relMountLabel;
private javax.swing.JTextField relMountTextField;
private javax.swing.JLabel cvsExeLabel;
private javax.swing.JTextField cvsExeTextField;
private javax.swing.JButton cvsExeButton;
private javax.swing.JCheckBox cygwinCheckBox;
private javax.swing.JLabel cygwinLabel;
private javax.swing.JTextField cygwinTextField;
private javax.swing.JButton cygwinButton;
private javax.swing.JLabel refreshLabel;
private javax.swing.JTextField refreshTextField;
private javax.swing.JLabel jLabel10;
private javax.swing.JButton loginButton;
// End of variables declaration//GEN-END:variables
private CvsFileSystem fileSystem=null;
private PropertyChangeSupport changeSupport=null;
private volatile boolean isRootNotSetDlg = true;
private String lastRootValue = "";
private volatile JDialog rootNotSetDlg = null;
//-------------------------------------------
public static void main(java.lang.String[] args) {
JDialog dialog=new JDialog(new Frame (), true );
CvsCustomizer customizer= new CvsCustomizer();
dialog.getContentPane().add(customizer);
dialog.pack ();
dialog.show();
}
//-------------------------------------------
public void addPropertyChangeListener(PropertyChangeListener l) {
//D.deb("addPropertyChangeListener()"); // NOI18N
changeSupport.addPropertyChangeListener(l);
}
//-------------------------------------------
public void removePropertyChangeListener(PropertyChangeListener l) {
//D.deb("removePropertyChangeListener()"); // NOI18N
changeSupport.removePropertyChangeListener(l);
}
//-------------------------------------------
public void setObject(Object bean){
E.deb("setObject("+bean+")"); // NOI18N
fileSystem=(CvsFileSystem)bean;
/*
if (fileSystem.isValid()) {
D.deb("Filesystem valid, bud customized. SETTING TO NOT VALID !!");
fileSystem.setValidFS(false);
}
*/
String module = fileSystem.getCvsModule();
relMountTextField.setText(module);
moduleTextField.setText(fileSystem.getCvsModuleName());
rootDirTextField.setText(VcsFileSystem.substractRootDir(fileSystem.getRootDirectory().toString(), module));
refreshTextField.setText (""+fileSystem.getCustomRefreshTime ()); // NOI18N
serverTextField.setText (fileSystem.getCvsServer ());
userTextField.setText (fileSystem.getCvsUserName ());
repositoryTextField.setText (fileSystem.getCvsRoot());
String st = fileSystem.getCvsServerType ();
if(st.equals (fileSystem.CVS_SERVER_LOCAL)) localRadioButton.setSelected (true);
else if (st.equals (fileSystem.CVS_SERVER_SERVER)) serverRadioButton.setSelected (true);
else if (st.equals (fileSystem.CVS_SERVER_PSERVER)) pserverRadioButton.setSelected (true);
cvsExeTextField.setText (fileSystem.getCvsExePath ());
cygwinCheckBox.setSelected (fileSystem.isUseUnixShell ());
cygwinTextField.setText (fileSystem.getCygwinPath ());
updateEnabledComponents();
fileSystem.setCvsRoot(repositoryTextField.getText());
}
/**
* @return true when the root directory textfield was changed, false if not.
*/
boolean isRootChanged() {
boolean ch;
String selected = rootDirTextField.getText ();
ch = !selected.equals(lastRootValue);
lastRootValue = selected;
return ch;
}
private JDialog notifyMessage(String message) {
JOptionPane pane = new JOptionPane(message, JOptionPane.INFORMATION_MESSAGE);
JDialog presenter = pane.createDialog(this,
NbBundle.getBundle (NotifyDescriptor.class).getString("NTF_InformationTitle"));
return presenter;
}
private JDialog notifyMessageTF(String messageLabel, String messageText) {
JOptionPane pane = new JOptionPane(messageLabel, JOptionPane.INFORMATION_MESSAGE);
JTextField text = new JTextField(messageText);
text.setEditable(false);
pane.add(text, 1);
JDialog presenter = pane.createDialog(this,
NbBundle.getBundle (NotifyDescriptor.class).getString("NTF_InformationTitle"));
return presenter;
}
/**
* Change the root directory of the filesystem. Get the directory from the text field
* and perform the change in the filesystem. If the root directory does not exists and
* <code>info</code> is <code>true</code>, nothing is changed.
* @param info whether to inform the user of nonexistent root directory.
*/
private void rootDirChanged (boolean info) {
// root dir set by hand
String selected = rootDirTextField.getText ();
/*
String module = moduleTextField.getText ();
String moduleDir = module.equals ("") ? selected : selected + java.io.File.separator + module; // NOI18N
File dir=new File(moduleDir);
*/
File root = new File(selected);
if( info && !root.isDirectory() ){
//E.err("not directory "+root); // NOI18N
final String badDir = root.toString();
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
if (browseButton.hasFocus()) {
try {
Thread.sleep(200);
} catch(InterruptedException e) {
// Ignoring interruption
}
}
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
if (isRootNotSetDlg) {
isRootNotSetDlg = false;
rootNotSetDlg = notifyMessage(MessageFormat.format (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.notDirectory"), new Object[] { badDir } ));
rootNotSetDlg.setVisible(true);
//TopManager.getDefault ().notify (new NotifyDescriptor.Message(MessageFormat.format (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.notDirectory"), new Object[] { badDir } )));
isRootNotSetDlg = true;
}
}
});
}
});
}
});
return ;
}
try{
fileSystem.setRootDirectory(root);
rootDirTextField.setText(selected);
}
catch (PropertyVetoException veto){
fileSystem.debug(org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.canNotChangeWD"));
//E.err(veto,"setRootDirectory() failed"); // NOI18N
}
catch (IOException e){
E.err(e,"setRootDirectory() failed"); // NOI18N
final String badDir = root.toString();
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
if (isRootNotSetDlg) {
isRootNotSetDlg = false;
TopManager.getDefault ().notify (new NotifyDescriptor.Message(MessageFormat.format (org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.cannotSetDirectory"), new Object[] { badDir } )));
isRootNotSetDlg = true;
}
}
});
}
}
private void removeEnterFromKeymap() {
MiscStuff.removeEnterFromKeymap(userTextField);
MiscStuff.removeEnterFromKeymap(serverTextField);
MiscStuff.removeEnterFromKeymap(repositoryTextField);
MiscStuff.removeEnterFromKeymap(rootDirTextField);
MiscStuff.removeEnterFromKeymap(moduleTextField);
MiscStuff.removeEnterFromKeymap(relMountTextField);
MiscStuff.removeEnterFromKeymap(cvsExeTextField);
MiscStuff.removeEnterFromKeymap(cygwinTextField);
MiscStuff.removeEnterFromKeymap(refreshTextField);
}
private void updateEnabledComponents () {
if(localRadioButton.isSelected ()) {
userTextField.setEnabled (false);
serverTextField.setEnabled (false);
loginButton.setEnabled (false);
userNameLabel.setEnabled (false);
repositoryButton.setEnabled (true);
serverLabel.setEnabled (false);
} else {
userTextField.setEnabled (true);
serverTextField.setEnabled (true);
loginButton.setEnabled (true);
userNameLabel.setEnabled (true);
repositoryButton.setEnabled (false);
serverLabel.setEnabled (true);
}
String osName = System.getProperty("os.name");
if(osName.indexOf("Win") >= 0) { // NOI18N
cygwinCheckBox.setEnabled (true);
if (cygwinCheckBox.isSelected ()) {
cygwinLabel.setEnabled (true);
cygwinTextField.setEnabled (true);
cygwinButton.setEnabled (true);
} else {
cygwinLabel.setEnabled (false);
cygwinTextField.setEnabled (false);
cygwinButton.setEnabled (false);
}
} else {
cygwinCheckBox.setVisible (false);
cygwinLabel.setVisible (false);
cygwinTextField.setVisible (false);
cygwinButton.setVisible (false);
}
}
private void refreshChanged () {
try {
int time = Integer.parseInt(refreshTextField.getText());
if (time < 0) throw new NumberFormatException(""+time); // NOI18N
fileSystem.setCustomRefreshTime (time);
} catch (NumberFormatException e) {
final String msg = e.getMessage();
E.deb(msg);
refreshTextField.setText (""+fileSystem.getCustomRefreshTime ()); // NOI18N
javax.swing.SwingUtilities.invokeLater(new Runnable () {
public void run () {
TopManager.getDefault ().notify (new NotifyDescriptor.Message("'"+msg+"': "+org.openide.util.NbBundle.getBundle(CvsCustomizer.class).getString("CvsCustomizer.nonNegative")));
}
});
}
}
//-------------------------------------------
String g(String s) {
D.deb("getting "+s);
return NbBundle.getBundle
("org.netbeans.modules.vcs.cmdline.Bundle").getString (s);
}
String g(String s, Object obj) {
return MessageFormat.format (g(s), new Object[] { obj });
}
String g(String s, Object obj1, Object obj2) {
return MessageFormat.format (g(s), new Object[] { obj1, obj2 });
}
String g(String s, Object obj1, Object obj2, Object obj3) {
return MessageFormat.format (g(s), new Object[] { obj1, obj2, obj3 });
}
}
/*
* Log
* 36 Gandalf-post-FCS1.32.2.2 4/4/00 Martin Entlicher Enter removed from the
* keymap of textfields
* 35 Gandalf-post-FCS1.32.2.1 4/4/00 Martin Entlicher Repository set to the
* filesystem.
* 34 Gandalf-post-FCS1.32.2.0 3/23/00 Martin Entlicher ToolTip texts added,
* module selector added, relative mount point added, notify message
* changed
* 33 Gandalf 1.32 2/15/00 Martin Entlicher Changes in information
* dialog about nonexistent directories.
* 32 Gandalf 1.31 2/11/00 Martin Entlicher Different
* setRootDirectory argument.
* 31 Gandalf 1.30 2/10/00 Martin Entlicher Does not check the
* existence of working and module directory.
* 30 Gandalf 1.29 2/10/00 Martin Entlicher Order of entries changed
* (Working Directory)
* 29 Gandalf 1.28 1/17/00 Martin Entlicher NOI18N
* 28 Gandalf 1.27 1/15/00 Ian Formanek NOI18N
* 27 Gandalf 1.26 1/11/00 Jesse Glick Context help.
* 26 Gandalf 1.25 1/11/00 Jesse Glick Context help.
* 25 Gandalf 1.24 1/7/00 Martin Entlicher Dilaog when can not set
* root directory added.
* 24 Gandalf 1.23 1/6/00 Martin Entlicher
* 23 Gandalf 1.22 12/28/99 Martin Entlicher
* 22 Gandalf 1.21 12/21/99 Martin Entlicher Added support for Cygwin
* and path to the cvs executable.
* 21 Gandalf 1.20 12/16/99 Martin Entlicher
* 20 Gandalf 1.19 12/15/99 Martin Entlicher Refresh time: check for
* correct input
* 19 Gandalf 1.18 11/30/99 Martin Entlicher
* 18 Gandalf 1.17 11/27/99 Patrik Knakal
* 17 Gandalf 1.16 11/24/99 Martin Entlicher The order of components
* changed.
* 16 Gandalf 1.15 11/23/99 Martin Entlicher
* 15 Gandalf 1.14 11/10/99 Martin Entlicher
* 14 Gandalf 1.13 11/10/99 Martin Entlicher
* 13 Gandalf 1.12 11/9/99 Martin Entlicher
* 12 Gandalf 1.11 10/25/99 Pavel Buzek
* 11 Gandalf 1.10 10/23/99 Ian Formanek NO SEMANTIC CHANGE - Sun
* Microsystems Copyright in File Comment
* 10 Gandalf 1.9 10/12/99 Pavel Buzek
* 9 Gandalf 1.8 10/10/99 Pavel Buzek
* 8 Gandalf 1.7 10/9/99 Pavel Buzek
* 7 Gandalf 1.6 10/9/99 Pavel Buzek
* 6 Gandalf 1.5 10/9/99 Pavel Buzek
* 5 Gandalf 1.4 10/8/99 Pavel Buzek
* 4 Gandalf 1.3 10/7/99 Pavel Buzek
* 3 Gandalf 1.2 10/7/99 Pavel Buzek
* 2 Gandalf 1.1 10/5/99 Pavel Buzek VCS at least can be
* mounted
* 1 Gandalf 1.0 9/30/99 Pavel Buzek
* $
*/